<!--
ModelDialog 是针对业务单表的新增、编辑、详情的方法，提供公共组件
-->
<template>
  <el-dialog
    ref="modelDialog"
    :title="title"
    v-if="dialogVisible"
    :visible.sync="dialogVisible"
    :width="modelWidth"
    :before-close="handleClose"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    :destroy-on-close="true"
    :lock-scroll="false"
    v-bind="$attrs"
    v-on="$listeners"
  >
    <div class="min-body-height">
      <slot
        ref="modelDialogSlot"
        name="dialog-content"
        :dataId="dataId"
        :tableData="tableData"
        :operatorType="operatorType"
        :isLoadData="isLoadData"
        :loadDataUrl="loadDataUrl"
        :serviceParam="serviceParam"
      />
    </div>
    <!--增加了业务参数-->
    <span
      v-if="isShowButton"
      slot="footer"
      class="dialog-footer"
    >
      <el-button
        size="small"
        @click="closeDialog"
      >取 消</el-button>
      <el-button
        size="small"
        :loading="loading"
        type="primary"
        @click="onsubmit"
        :disabled="ifDisabled"
      >确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import {
  ModelDialogMixins
} from '@/mixins/ModelDialogMixins'
export default {
  name: 'ModelDialog',
  mixins: [ModelDialogMixins],
  computed: {
    isShowButton: function () {
      return this.operatorType === '1' ? false : true
    }
  },

}
</script>

<style lang="scss" scoped>
</style>
